| 1. | Trigger for external synchronization 触发器为外在同步 |
| 2. | Thread - hostile classes are those that cannot be rendered safe to use concurrently , regardless of what external synchronization is invoked 线程对立类是那些不管是否调用了外部同步都不能在并发使用时安全地呈现的类。 |
| 3. | Central to this classification system is whether or not a caller can or must surround operations - or sequences of operations - with external synchronization 这种分类系统的核心是调用者是否可以或者必须用外部同步包围操作(或者一系列操作) 。 |
| 4. | By documenting that a class is thread - hostile , you inform users that they cannot use the class safely from multiple threads , even with external synchronization 通过将类记录为线程对立的,您就告知用户即使使用了外部同步,他们也不能在多线程中安全地使用这个类。 |
| 5. | " conditionally thread - safe classes are those for which each individual operation may be thread - safe , but certain sequences of operations may require external synchronization 有条件的线程安全类对于单独的操作可以是线程安全的,但是某些操作序列可能需要外部同步。 |
| 6. | Can complete safely without additional synchronization , there are several common sequences of operations , such as iteration or put - if - absent , which still require external synchronization to avoid data races 之类的简单操作可以在不需要额外同步的情况下安全地完成,但还是有一些公用的操作序列,例如迭代或者put - if - absent (空则放入) ,需要外部的同步,以避免数据争用。 |
| 7. | Thread - safe , you perform two valuable services : you inform maintainers of the class that they should not make modifications or extensions that compromise its thread safety , and you inform users of the class that it can be used without external synchronization 线程安全的) ,您就提供了两种有价值的服务:您告知类的维护者不要进行会影响其线程安全性的修改或者扩展,您还告知类的用户使用它时可以不使用外部同步。 |